package org.jeecg.modules.knowledge.service;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.jeecg.modules.knowledge.entity.PhilKnowledge;
import com.baomidou.mybatisplus.extension.service.IService;
import org.joda.time.DateTime;

/**
 * @Description: 知识
 * @Author: jeecg-boot
 * @Date:   2020-12-20
 * @Version: V1.0
 */
public interface IPhilKnowledgeService extends IService<PhilKnowledge> {

    /**
     * TODO: 分页查询  根据知识类别（栏目）获取对应的文章
     *
     *
     * @author ZhangHaoyu
     * @param page
     * @param knowledgeType
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<org.jeecg.modules.knowledge.entity.PhilKnowledge>
     */
    Page<PhilKnowledge> getSortKnowledgeByType(Page<PhilKnowledge> page, String knowledgeType);

    /**
     * TODO: 根据文章id增加阅读量
     *
     * @param id 文章id
     */
    void incrReadNum(String id);

    /**
     * TODO: 通过关键字获取文章列表
     *
     *
     * @author ZhangHaoyu
     * @param page
     * @param keyword
     * @return com.baomidou.mybatisplus.extension.plugins.pagination.Page<org.jeecg.modules.knowledge.entity.PhilKnowledge>
     */
    Page<PhilKnowledge> getSortKnowledgeByKeyword(Page<PhilKnowledge> page, String keyword);

    /**
     * TODO:向关键字和知识库表中插入数据
     *
     *
     * @author ZhangHaoyu
     * @param philKnowledge
     * @return void
     */
    void insertKeywordKnowledge(PhilKnowledge philKnowledge);

    /**
     * TODO: 根据文章id删除
     *
     *
     * @author ZhangHaoyu
     * @param id
     * @return void
     */
    void delKeywordKnowledge(String id);

    /**
     * TODO:
     *
     *
     * @author ZhangHaoyu
     * @param monday
     * @param sunday
     * @return int
     */
    int count(DateTime monday, DateTime sunday);
}
